import pymysql

conn = pymysql.connect(
    host='127.0.0.1',
    port=3306,
    user='root',
    password='123456',
    database='mumushouji',
    charset='utf8'
)


sql = 'select * from user'
cursor = conn.cursor()
cursor.execute(sql)

result = cursor.fetchall()
print(result)
for row in result:
    print(row)

cursor.close()
conn.close()
